home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-04-08 | 1.4 KB | 45 lines | [TEXT/CCL2] |
- #|
- file: open-all-text-files.lisp
- version: 1.0
- last edited: 03-12-92
- copyright © 1989, 1992 Steven L Mitchell/Carbon-based Metaphors.
- Licensed users of MCL2 may use this code freely.
-
- Uses the new function choose-directory-dialog.
-
- The user types meta-a, and chooses a directory.
- All text files in the directory are opened into Fred windows.
- |#
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;
- ;;; open-all-text-files
- ;;;
- ;;; Fred command: meta-a.
- ;;;
- ;;; Open all the text files in a directory.
- ;;;
-
- (def-fred-command (:meta #\a) open-all-text-files)
-
- (defmethod open-all-text-files ((w fred-mixin))
- "Open all TEXT files in a directory."
- (let (dir-pathnamestring
- file-pathnames)
- (setf dir-pathnamestring (choose-directory-dialog))
- (setf file-pathnames
- (nreverse
- (directory (concatenate 'string dir-pathnamestring "*")
- :test #'(lambda (path-name)
- (equal (mac-file-type path-name) :TEXT))
- :resolve-aliases t)))
- (format t "Opening ~D files..." (length file-pathnames))
- (stream-force-output *standard-output*)
- (mapcar #'(lambda (path-name) (ed path-name))
- file-pathnames)
- (format t "done.~%"))
- (values))
-
-
- ; end of file open-all-text-files.lisp
- ;-------------------------------------------